package cn.bonoon.kernel.menus.tips;

import cn.bonoon.kernel.VisibleScope;
import cn.bonoon.kernel.menus.PlatformContext;

public class MenuTipDefinition implements MenuTipArguments{
	
	/** 处理接口的名称 */
	private String value;
	
	private MenuTipType type;
	
	private boolean refreshable;
	
	/** 是否在每个子系统的首页里显示这个菜单的提示信息；如果是，则可以在首页里直接进入这个菜单 */
	private boolean inHome;
	
	/** 参数里定义的格式化字符串 */
	private String format;
	
	private VisibleScope scope;
	
	public boolean isRefreshable() {
		return refreshable;
	}

	public void setRefreshable(boolean refreshable) {
		this.refreshable = refreshable;
	}

	public boolean isInHome() {
		return inHome;
	}

	public void setInHome(boolean inHome) {
		this.inHome = inHome;
	}

	public String getFormat() {
		return format;
	}

	public void setFormat(String format) {
		this.format = format;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public MenuTipType getType() {
		return type;
	}

	public void setType(MenuTipType type) {
		this.type = type;
	}

	public MenuTipHandler resolveHandler(PlatformContext platformContext) throws Exception{
		return type.resolve(platformContext, value);
	}

	public VisibleScope getScope() {
		return scope;
	}

	public void setScope(VisibleScope scope) {
		this.scope = scope;
	}
}
